﻿#region Using directives

using System;

#endregion

namespace NiSis.Entities
{	
	///<summary>
	/// An object representation of the 'Ssh_Trader_Prec_Storico' table. [No description found the database]	
	///</summary>
	/// <remarks>
	/// This file is generated once and will never be overwritten.
	/// </remarks>	
	[Serializable]
	[CLSCompliant(true)]
	public partial class SshTraderPrecStorico : SshTraderPrecStoricoBase
	{		
		#region Constructors

		///<summary>
		/// Creates a new <see cref="SshTraderPrecStorico"/> instance.
		///</summary>
		public SshTraderPrecStorico():base(){}

        
	
		
		#endregion
        /// <summary>
        /// Setta lo stato a value globalmente in tutte le utenze appartenente al 
        /// trader precedente
        /// </summary>
        public int State
        {

            set
            {
                foreach (SshUtenzeGasStorico sh in this.SshUtenzeGasStoricoCollection)
                    sh.IdStato = value;
            }
        }
        public SshStatoRelazioniList GetState()
        {
            int prev;
            if (SshUtenzeGasStoricoCollection.Count == 0)
            {
                
            }
                return (SshStatoRelazioniList) SshUtenzeGasStoricoCollection[0].IdStato;

            prev=(SshUtenzeGasStoricoCollection[0].IdStato??0);
            foreach (SshUtenzeGasStorico ut in this.SshUtenzeGasStoricoCollection)
            {
                if (ut.IdStato != prev)
                    return SshStatoRelazioniList.NonIpotizzato;
            }
            return (SshStatoRelazioniList) prev;

        }
    }
}
